<template>
<div class="top" v-if="info.details !== {}">
  <div class="header">
      <span>{{info.details?.hospital?.hosname}}</span>
      <svg t="1693308910134" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4055" width="16" height="16"><path d="M857.28 344.992h-264.832c12.576-44.256 18.944-83.584 18.944-118.208 0-78.56-71.808-153.792-140.544-143.808-60.608 8.8-89.536 59.904-89.536 125.536v59.296c0 76.064-58.208 140.928-132.224 148.064l-117.728-0.192A67.36 67.36 0 0 0 64 483.04V872c0 37.216 30.144 67.36 67.36 67.36h652.192a102.72 102.72 0 0 0 100.928-83.584l73.728-388.96a102.72 102.72 0 0 0-100.928-121.824zM128 872V483.04c0-1.856 1.504-3.36 3.36-3.36H208v395.68H131.36A3.36 3.36 0 0 1 128 872z m767.328-417.088l-73.728 388.96a38.72 38.72 0 0 1-38.048 31.488H272V476.864a213.312 213.312 0 0 0 173.312-209.088V208.512c0-37.568 12.064-58.912 34.72-62.176 27.04-3.936 67.36 38.336 67.36 80.48 0 37.312-9.504 84-28.864 139.712a32 32 0 0 0 30.24 42.496h308.512a38.72 38.72 0 0 1 38.048 45.888z" p-id="4056" fill="#d81e06"></path></svg>
      <span>{{info.details?.hospital?.param?.hostypeString}}</span>
  </div>

  <div class="content">
    <div class="left">
      <img :src="`data:image/jpeg;base64,${info.details?.hospital?.logoData}`" alt="图片加载中">
    </div>
    <div class="right">
      <p>挂号规则</p>
      <p><span>预约周期：</span>{{info.details?.bookingRule?.cycle}}<span>天&nbsp;&nbsp;&nbsp;</span>
        <span>放号时间：</span>{{info.details?.bookingRule?.releaseTime}}
        <span>停挂时间：</span>{{info.details?.bookingRule?.stopTime}}
      </p>
      <p>具体位置：{{info.details?.hospital?.param?.fullAddress}}</p>
      <p>具体路线：{{info.details?.hospital?.route}}</p>
      <p>退号时间：就诊前一工作日{{info.details?.bookingRule?.quitTime}}前取消</p>
      <p>预约挂号规则</p>
      <p v-for="(item,index) in info.details?.bookingRule?.rule">{{item}}</p>
    </div>
  </div>
</div>
  <el-empty v-else description="暂无数据" />
  <div class="bottom">
    <el-empty description="暂无数据" />
  </div>
</template>

<script setup lang="ts">
import {onMounted,reactive,ref} from 'vue'
import {hospitalInfoDetailStore} from '@/store/modules/hospitalStore'
import type {HospitalInfo} from '@/api/hospital/type'

const hospitalInfoStore = hospitalInfoDetailStore()

let info = reactive({
  "details":{} as HospitalInfo
})

!onMounted(()=>{
  info.details = hospitalInfoStore.$state.hospitalDetail as HospitalInfo
  console.log(info.details)
})
</script>

<style scoped lang="scss">
.top{
  .header{
      display: flex;
      justify-content: start;
      align-items: center;
      span:first-child{
        margin: 20px 5px 4px 50px;
        font-weight: bold;
        font-size: 25px;
      }
      span:last-child{
        margin: 20px 5px 4px 0;
        color: #7f7f7f;
        font-size: 16px;
      }
      svg{
        margin: 20px 5px 4px 2px;
      }
  }
  .content{
    display: flex;
    .left{
      img{
        margin: 20px 20px 0 50px;
        width: 80px;
        height: 80px;
        border-radius: 80px;
      }
    }
    .right{
      margin: 20px 20px 0 0;
      p:nth-child(6){
        font-weight: bold;
        color: black;
      }
      p:first-child{
        font-weight: bold;
        color: black;
      }
      p{
        font-size: 16px;
        margin: 8px 0 ;
        color: #7f7f7f;
      }

    }
  }
}
</style>